package cn.hanyx.coder.design.pattern.behavioral.visitor.demo03;

import java.util.ArrayList;
import java.util.List;

/**
 * ToolApplication
 *
 * @author hanyx
 * @date 2020/07/28
 */
public class ToolApplication {

    public static void main(String[] args) {
        List<ResourceFile> resourceFiles = new ArrayList<>();
        resourceFiles.add(new PdfFile("a.pdf"));
        resourceFiles.add(new WordFile("b.word"));
        resourceFiles.add(new PPTFile("c.ppt"));

        Extractor extractor = new Extractor();
        for (ResourceFile resourceFile : resourceFiles) {
            resourceFile.accept(extractor);
        }
    }
}
